/**
 * 
 */
package cz.cuni.mff.abacs.burglar.logics.objects.agents;

import java.util.List;

import cz.cuni.mff.abacs.burglar.logics.DataMap;
import cz.cuni.mff.abacs.burglar.logics.objects.BaseInterface;
import cz.cuni.mff.abacs.burglar.logics.objects.Room;
import cz.cuni.mff.abacs.burglar.logics.objects.items.Inventory;
import cz.cuni.mff.abacs.burglar.logics.objects.items.Item;
import cz.cuni.mff.abacs.burglar.logics.objects.items.Key;
import cz.cuni.mff.abacs.burglar.logics.objects.positions.Lockable;
import cz.cuni.mff.abacs.burglar.logics.objects.positions.Position;
import cz.cuni.mff.abacs.burglar.logics.planning.instructions.Instruction;


/** 
 * Moving elements of the game.
 * 
 * Can be guards, burglars, dogs...
 * @author abacs
 *
 */
public interface Agent extends BaseInterface, Inventory {
	
	
	/**  */
	public enum State {UNSET, DISCOVERING, FLEEING};
	
	
	/**
	 * Returns the position where the agent is standing.
	 * 
	 * @return
	 */
	public Position getPosition();
	
	
	/**
	 * Returns the id of the current position.
	 * 
	 * @return
	 */
	public int getPositionId();
	
	
	/**
	 * Positions the agent to the selected place.
	 * 
	 * If the user enters a new room, it also looks around in the new room.
	 * 
	 * It also examines the position if it is a door.
	 * 
	 * @param stepable
	 * @return true if the move was successful.
	 */
	public boolean moveTo(Position stepable);

	
	/**
	 * 
	 * It also examines the position.
	 * 
	 * @return success indicator
	 */
	public boolean open(Lockable lockable);
	
	
	/**
	 * It also examines the position.
	 * 
	 * @return success indicator
	 */
	public boolean close(Lockable lockable);
	
	
	/**
	 * It also examines the position.
	 * 
	 * @return success indicator
	 */
	public boolean unlock(Lockable lockable, Key key);
	
	
	/**
	 * It also examines the position.
	 * 
	 * @return success indicator
	 */
	public boolean lock(Lockable lockable, Key key);
	
	
	/**
	 * It also examines the position.
	 * 
	 * @return success indicator
	 */
	public boolean pickUp(Inventory inventory, Item item);
	
	
	/**
	 * 
	 * @return
	 */
	public Room getRoom();
	
	
	/**
	 * 
	 * @return
	 */
	public int getRoomId();
	
	
	/**
	 * 
	 * 
	 * @param room
	 * @return 
	 */
	public boolean isInRoom(Room room);
	
	
	/**
	 * 
	 * 
	 * @param roomId
	 * @return 
	 */
	public boolean isInRoom(int roomId);
	
	
	// -------------------------------------------------------------------------
	// instructions:
	
	
	/**
	 * 
	 */
	public void addInstruction(Instruction instruction);
	
	
	/**
	 * 
	 */
	public void addInstructions(List<Instruction> instructions);
	
	
	/**
	 * 
	 */
	public void clearInstructions();
	
	
	/**
	 * Returns the instruction list for a selected agent.
	 *  
	 * @param agent
	 * @return
	 */
	public List<Instruction> getInstructions();
	
	
	/**
	 * Returns the first instruction for a selected agent. 
	 * It also removes it from the main list.
	 * 
	 * @param agent
	 * @return
	 */
	public Instruction popFirstInstruction();
	
	
	/**
	 * 
	 * @return
	 */
	public BeliefBase getBeliefBase();
	
	
	/**
	 * 
	 * 
	 * @param original
	 */
	public void copyChangeables(Agent original);
	
	
	/**
	 * 
	 * @param reference
	 * @return
	 */
	public Agent copy(DataMap reference);
	
}
